Repository navigation
Do not prefix declarations inside @supports with supports: false - #1569
Merged
Merged
Conversation
Member
|
Can you show an example: input, now, with-this-pr? |
Contributor
Author
|
Sure. I ran the same CSS with Input @supports (position: sticky) {
.item {
position: sticky;
}
}Current output @supports (position: sticky) {
.item {
position: -webkit-sticky;
position: sticky;
}
}With this PR @supports (position: sticky) {
.item {
position: sticky;
}
}The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! This addresses #1266.
With
supports: false, Autoprefixer already skipped prefixing the@supportscondition itself, but declarations inside the block were still prefixed. For example,@supports (position: sticky) { position: sticky }still producedposition: -webkit-stickyfor old browsers — yet that block only ever runs in browsers that already pass the feature query, so the prefixed declaration inside is dead code.This change skips both property and value prefixing for declarations nested inside an
@supportsblock whensupports: false, leaving selector prefixing, prefix removal and warnings untouched. The README description of the option is updated to match.Tests: 4 new cases in test/autoprefixer.test.js (inside-block value/property prefixing skipped, nested @media > @supports skipped, default behaviour still prefixes, outside-block declarations still prefixed).
pnpm run unitpasses 287/287 and lint is clean.Please let me know if you'd rather keep the old behaviour — happy to adjust.